feat: ai skills post-install-hook init, fastInstall implemented#1539
Open
KartikJha wants to merge 5 commits into
Open
feat: ai skills post-install-hook init, fastInstall implemented#1539KartikJha wants to merge 5 commits into
KartikJha wants to merge 5 commits into
Conversation
f2943b1 to
ae759dc
Compare
555e6c1 to
92c5be0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔧 Changes
Adds a new
internal/ai/skillspackage that implements the core logic for downloading and installing Auth0 AI skills into local AI coding agent environments.New package:
internal/ai/skillsagent.go— definesAgentConfigwith detection logic for 20+ AI coding agents (Claude Code, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Codex, Roo, Goose, and more). ExposesDetectedAgents()(lazy-cached, thread-safe),FastPriorityAgents()(priority-ordered list placing popular agents first), andResetDetectedAgentsCache().download.go— downloads theauth0/agent-skillsplugin from GitHub into a local directory using a tiered strategy: git sparse-checkout (preferred, requires git ≥ 2.25) → tar.gz → ZIP. All work happens in a temp directory; the target is only overwritten on success. Returns the resolved commit SHA.symlink.go— installs a named skill from the downloaded plugin into an agent's skills directory as a symlink (default) or a recursive copy (for agents/platforms that don't follow symlinks). Idempotent.lock.go— reads/writes askills-lock.jsonthat records the installed repo, ref, commit SHA, installed-at/updated-at timestamps, skill list, target agents, and scope (global/local). Uses OS-level file locking (flock) to coordinate concurrent access (Unix and Windows implementations).skill_meta.go— parses YAML frontmatter fromSKILL.mdfiles in the downloaded plugin to enumerate available skills with names and descriptions.fs_util.go— shared filesystem helpers (mergeDir,copyFile) used as a cross-filesystem fallback when atomic rename is not possible.validate.go— validates skill directory structure.Full unit-test coverage accompanies every new file.
📚 References
🔬 Testing
The new package ships with comprehensive unit tests covering:
AgentConfig.IsInstalled()— marker path, binary PATH lookup, env var markers, empty/nil casesAgentConfig.ResolvedGlobalSkillsDir()— env var override, fallback, error on missing configSupportedAgentsinvariants — unique IDs, required agents present, detection-free agents, per-agent config correctness (CodexCODEX_HOME, Mistral VibeVIBE_HOME, Copilotghbinary exclusion)DetectedAgents()/ResetDetectedAgentsCache()— cache consistency, filesystem state changes after resetFastPriorityAgents()— ordering, no duplicates, universal always lastRun with: